-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyPIM integration #1091
PyPIM integration #1091
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1091 +/- ##
==========================================
+ Coverage 73.02% 73.06% +0.04%
==========================================
Files 43 43
Lines 6383 6394 +11
==========================================
+ Hits 4661 4672 +11
Misses 1722 1722 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me.
@@ -0,0 +1,64 @@ | |||
"""Test the PyPIM integration.""" | |||
from unittest.mock import create_autospec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why unittest
? I cannot even see when this is installed in pymapdl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unittest
is a standard Python library: https://docs.python.org/3/library/unittest.html
That being said, we should be using pytest
instead.
This appears to be compatible with pytest
, so there's no issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fortunately pytest is very unopinionated on how the assertion are done, only on how tests are declared. Here I created the mocks using the built-in unittest (pytest does not have any specific tooling for that), but injected them with the monkeypatch
fixture from pytest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is pytest-mock
but yeah... another package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @plule-ansys!
This PR integrates PyPIM in the
launch_mapdl
function. The intention is that a caller usingpymapdl.launch_mapdl()
without specific instructions on how to launch it will be redirected to using a remote instance when this is running in a pre-configured environment. This is the workflow targeted in the internal Ansys Lab.This method will use PyPIM under the condition that:
In this workflow, most of the configuration (arguments, ...) is ignored. While some of these configuration may be reintroduced later, the initial version of PIM delegates all the control server side.